package org.itli.wacp.Mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.itli.wacp.pojo.User;

import java.util.List;
import java.util.Map;

@Mapper
public interface UserMapper {

    //用户登陆
    User Login(Map<String,String> map);

    //注册
    int Regist(User user);

    //查询是否为会员
    @Select("  select `time` from `member` where id=#{id}")
    String Member(String id);

    @Select("select * from user where id = #{id}")
    User Found(String id);

    @Insert("UPDATE user SET email = #{email} WHERE id = #{id} ")
    int UpdateEmail(String id,String email);

    //查询邮箱
    @Select("select email from user where id = #{id}")
    String GetEmail(String id);

    //修改密码
    @Update("UPDATE user SET password = #{password} WHERE id = #{id}")
    int ChangePassword(String id,String password);
}
